<%layout("/common/_layout.html"){ %>

<style>
.table-title{
	width: 100px;
}
</style>

<script type="text/javascript">
    var keywordsObj = {};
    var submit_btn = function(businessType){
        if($("#org_id").val())
            keywordsObj.org_id = $("#org_id").val();
        if($("#displayName").val())
            keywordsObj.displayName = $("#displayName").val();
        if($("#className").val())
            keywordsObj.className = $("#className").val();
        if($("#start_time").val())
            keywordsObj.start_time = $("#start_time").val();
        console.log

        var keywords = "";
        if(!$.isEmptyObject(keywordsObj)){
            keywords = JSON.stringify(keywordsObj);
        }
        console.log("keywords = "+ keywords);

        $("#keywords").val(keywords);



        if(businessType == "search"){
            $("#list-form").submit();
        }else if(businessType == "export"){
            //window.location.href = "${base}/schoolSubject/exportAll?keywords="+keywords;
            $('#download').hide();
            //loading层
            var index = parent.layer.load(0, {
                shade: [0.1, '#fff'] //0.1透明度的白色背景
            });
            var formParam = $("#list-form").serialize();//序列化表格内容为字符串
            $.ajax({
                type: 'post',
                url: '${base}/schoolSubject/exportAll',
                data: formParam,
                success: function (data) {
                    console.log(data);
                    if (data.status == 1) {
                        $('#downloadlink').text(data.message);
                        $('#downloadlink').attr('href', data.url);
                        $('#download').show();
                    } else {
                        $('#downloadlink').text(data.message);
                        $('#download').show();
                    }
                    parent.layer.close(index);
                },
                error: function () {
                    parent.layer.close(index);
                }
            });



        }

    }

</script>

<%#ajax userTable:{%>
<div class="am-cf am-padding">
	<div class="am-fl am-cf">
		<strong class="am-text-primary am-text-lg">校园专区日统计报表</strong> / <small>列表</small>
	</div>
</div>

<div class="am-g">
	<%include("school_subject_query.tpl"){}%>
	<div class="am-u-sm-12 am-u-md-12"
		 style="padding: 0 1.6rem 1.6rem 1rem; margin: 0;">
		<div class="am-btn-toolbar" style="padding-left: .5rem;">
			<div class="am-btn-group am-btn-group-xs">
				<div class="am-btn-group am-btn-group-xs am-form-file">

				</div>
			</div>
		</div>
	</div>
</div>

<div class="am-g">
	<div class="am-u-sm-12">
		<div class="am-scrollable-horizontal">
			<table class="am-table am-table-striped am-table-hover table-main" style="TABLE-LAYOUT: fixed">
				<thead>
				<tr class="am-text-nowrap">
					<!--<th class="table-check"><input type="checkbox" id="allCheck"></th>-->

					<th class="table-title" >地市</th>
					<th class="table-title">区县</th>
					<th class="table-title">网点编码</th>
					<th class="table-title">网点名称</th>
					<th class="table-title">网点类型</th>
					<th class="table-title">今日登录用户数</th>
					<th class="table-title">今日活跃用户数</th>
					<th class="table-title">实名开卡办理量</th>
					<th class="table-title" >携号登记</th>

					<th class="table-title">有线宽带</th>
					<th class="table-title">区域流量</th>
					<th class="table-title">校园v网</th>
					<th class="table-title">校园前置营销</th>
					<th class="table-title">本地优惠</th>
				</tr>
				</thead>
				<tbody>
				<%for(item in pager.list!){%>
				<tr>
					<!--<td><input type="checkbox" <%{%>name="ids" value="${item.id}"<%}%> /></td>-->

					<td style="word-wrap:break-word;">${item.CityName}</td>
					<td style="word-wrap:break-word;">${item.AreaName}</td>
					<td style="word-wrap:break-word;">${item.NumCode}</td>
					<td style="word-wrap:break-word;">${item.DisplayName}</td>
					<td style="word-wrap:break-word;">${item.class_name}</td>
					<td style="word-wrap:break-word;">${item.loginCount}</td>
					<td style="word-wrap:break-word;">${item.activeCount}</td>
					<td style="word-wrap:break-word;">${item.newCard}</td>
					<td style="word-wrap:break-word;">${item.xiehao}</td>
					<td style="word-wrap:break-word;">${item.yxkd}</td>
					<td style="word-wrap:break-word;">${item.qyll}</td>
					<td style="word-wrap:break-word;">${item.vNet}</td>
					<td style="word-wrap:break-word;">${item.csbl}</td>
					<td style="word-wrap:break-word;">${item.bdyh}</td>





				</tr>
				<%}%>
				</tbody>
			</table>
		</div>

		<div class="am-cf">
			<!-- 分页 -->
			<%if (pager.list.~size > 0){%>
			<div class="am-fr"><% include("/admin/common_pager.tpl"){}%></div>
			<%}else{%>
			<div class="am-kai">
				<h3>没有找到任何记录!</h3>
			</div>
			<%}%>
		</div>

	</div>
</div>
<div class="am-modal am-modal-no-btn" tabindex="-1" id="modal">
	<div class="am-modal-dialog">
		<div class="am-modal-hd">
			<i class="am-icon-refresh am-icon-spin"></i> <a
				href="javascript: void(0)" class="am-close am-close-spin"
				data-am-modal-close>&times;</a>
		</div>
		<div class="am-modal-bd">正在处理，请稍等...</div>
	</div>
</div>
<%}%> <%}%>